package code._16reflect._06config;

import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.util.Properties;


public class Demo2 {
    public static void main(String[] args) throws IOException {
        URL systemResource = ClassLoader.getSystemResource("");
        System.out.println(systemResource);
        // file:/E:/java/mycode/out/production/mycode/

        InputStream in =ClassLoader.getSystemResourceAsStream("fileTest\\config.properties");
        System.out.println(in);
        Properties properties = new Properties();
        properties.load(in);
        String password = properties.getProperty("password");
        System.out.println("password = " + password);
    }
}
